/**
 * 
 */
package org.jenkon.decorator;

import java.util.Iterator;

/**
 * <p>
 * Decorator to decorate a {@link Iterator}.
 * </p>
 * 
 * @author Jens Konopka
 * 
 * @param <E> the type of value
 */
public abstract class IteratorDecorator<E> implements Iterator<E> {

	protected final Iterator<E> iterator;

	/**
	 * @param iterator the iterator to decorate
	 */
	public IteratorDecorator(final Iterator<E> iterator) {
		this.iterator = iterator;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.util.Iterator#hasNext()
	 */
	public boolean hasNext() {
		return iterator.hasNext();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.util.Iterator#next()
	 */
	public E next() {
		return iterator.next();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.util.Iterator#remove()
	 */
	public void remove() {
		iterator.remove();
	}

}
